home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / web / reduce / rweb / Makefile3.3 < prev    next >
Encoding:
Text File  |  1991-10-06  |  4.8 KB  |  153 lines

  1. # Copyright 1989 by Norman Ramsey, Odyssey Research Associates.
  2. # To be used for research purposes only.
  3. # For more information, see file COPYRIGHT in the parent directory.
  4.  
  5. HOME=/users/redusers#            # Make no longer inherits environment vars
  6.  
  7. THETANGLE=tangle
  8. THEWEAVE=weave
  9. SPIDER=any.spider
  10. #
  11. DVI=dvi
  12. CFLAGS=-DDEBUG -g -DSTAT
  13.  
  14. # CPUTYPE is a grim hack that attempts to solve the problem of multiple
  15. # cpus sharing a file system.  In my environment I have to have different
  16. # copies of object and executable for vax, sun3, next, iris, and other 
  17. # cpu types.  If you will be using Spidery WEB in a homogenous processor
  18. # environment, you can just set CPUTYPE to a constant, or eliminate it 
  19. # entirely.  
  20. #
  21. # In my environment, the 'cputype' program returns a string that
  22. # describes the current processor.  That means that the easiest thing
  23. # for you to do is to define a 'cputype' program that does something
  24. # sensible.  A shell script that says 'echo "vax"' is fine.
  25.  
  26. CPUTYPE=`cputype`
  27.  
  28. # Change the following three directories to match your installation
  29. #
  30. # the odd placement of # is to prevent any trailing spaces from slipping in
  31.  
  32. WEBROOT=$(HOME)/spider#     # root of the WEB source distribution
  33. DEST=$(HOME)/bin#         # place where the executables go
  34. MACROS=$(HOME)/tex/inputs#     # place where the macros go
  35.  
  36. MASTER=$(WEBROOT)/master#     # master source directory
  37. OBDIR=$(MASTER)/$(CPUTYPE)#    #common object files
  38.  
  39. TANGLESRC=tangle
  40. CTANGLE=ceetangle -I$(MASTER)
  41. CWEAVE=ceeweave -I$(MASTER)
  42. AWKTANGLE=awktangle -I$(MASTER)
  43. COMMONOBJS=$(OBDIR)/common.o $(OBDIR)/pathopen.o
  44. COMMONC=$(MASTER)/common.c $(MASTER)/pathopen.c
  45. COMMONSRC=$(COMMONC) $(MASTER)/spider.awk
  46.  
  47.  
  48. # Our purpose is to make tangle and weave
  49.  
  50. web: tangle weave
  51.  
  52. tangle: mktangle underscore
  53.  
  54. mktangle: $(COMMONOBJS) $(TANGLESRC).o
  55.     $(CC) $(CFLAGS) -o $(DEST)/$(THETANGLE) $(COMMONOBJS) $(TANGLESRC).o
  56.  
  57. weave: $(COMMONOBJS) weave.o
  58.     $(CC) $(CFLAGS) -o $(DEST)/$(THEWEAVE) $(COMMONOBJS) weave.o
  59.  
  60. underscore: $(DEST)/underscore underscore.web
  61.  
  62. $(DEST)/underscore:
  63.     $(CTANGLE) underscore.web
  64.     $(CC) $(CFLAGS) -o $(DEST)/underscore underscore.c
  65.     cp rtangle $(DEST)/rtangle3.3
  66.  
  67. source: $(TANGLESRC).c $(COMMONSRC) # make tangle.c and common src, then clean
  68.     if [ -f WebMakefile ]; then exit 1; fi  # don't clean the master!
  69.     if [ -f spiderman.tex ]; then exit 1; fi # don't clean the manual
  70.     -rm -f tangle.web weave.* common.* # remove links that may be obsolete
  71.     -rm -f *.unsorted *.list grammar.web outtoks.web scraps.web 
  72.     -rm -f cycle.test spider.slog
  73.     -rm -f *.o *.tex *.toc *.dvi *.log *.makelog *~ *.wlog *.printlog
  74.  
  75. # Here is how we make the common stuff
  76.  
  77. $(MASTER)/common.c: $(MASTER)/common.web # no change file
  78.     $(CTANGLE) $(MASTER)/common 
  79.  
  80. $(OBDIR)/common.o: $(MASTER)/common.c
  81.     $(CC) $(CFLAGS) -c $(MASTER)/common.c
  82.     mv common.o $(OBDIR)
  83.  
  84.  
  85. $(MASTER)/pathopen.c: $(MASTER)/pathopen.web # no change file
  86.     $(CTANGLE) $(MASTER)/pathopen 
  87.     mv pathopen.h $(MASTER)
  88.  
  89. $(OBDIR)/pathopen.o: $(MASTER)/pathopen.c
  90.     $(CC) $(CFLAGS) -c $(MASTER)/pathopen.c
  91.     mv pathopen.o $(OBDIR)
  92.  
  93. $(OBDIR):
  94.     if /bin/test ! -d $(OBDIR) ; then mkdir $(OBDIR) ; fi
  95.  
  96. ## Now we make the tangle and weave source locally
  97.  
  98. $(TANGLESRC).c: $(MASTER)/$(TANGLESRC).web $(MASTER)/common.h grammar.web rtangle.ch
  99.     -/bin/rm -f $(TANGLESRC).web
  100.     ln $(MASTER)/$(TANGLESRC).web $(TANGLESRC).web
  101. #    chmod -w $(TANGLESRC).web
  102.     $(CTANGLE) $(TANGLESRC) rtangle.ch
  103.  
  104. weave.c: $(MASTER)/weave.web $(MASTER)/common.h grammar.web rweave.ch 
  105.     -/bin/rm -f weave.web
  106.     ln $(MASTER)/weave.web weave.web
  107. #    chmod -w weave.web
  108.     $(CTANGLE) weave rweave.ch
  109.  
  110. ## Here's where we run SPIDER to create the source
  111.  
  112. grammar.web: $(MASTER)/cycle.awk $(MASTER)/spider.awk $(SPIDER)
  113.     echo "date" `date` | cat - $(SPIDER) | awk -f $(MASTER)/spider.awk
  114.     cat $(MASTER)/transcheck.list trans_keys.unsorted | awk -f $(MASTER)/transcheck.awk
  115.     awk -f $(MASTER)/cycle.awk < cycle.test
  116.     sort *.unsorted | awk -f $(MASTER)/nodups.awk
  117.     mv *web.tex $(MACROS)
  118.  
  119. ## We might have to make spider first.
  120.  
  121. $(MASTER)/spider.awk: $(MASTER)/spider.web
  122.     $(AWKTANGLE) $(MASTER)/spider
  123.     mv cycle.awk nodups.awk transcheck.awk $(MASTER)
  124.     rm junk.list
  125.  
  126.  
  127. # $(MASTER)/cycle.awk: $(MASTER)/cycle.web # making spider also makes cycle
  128. #     $(AWKTANGLE) $(MASTER)/cycle
  129.  
  130.  
  131. # This cleanup applies to every language
  132.  
  133. clean:
  134.     if [ -f WebMakefile ]; then exit 1; fi # don't clean the master!
  135.     if [ -f spiderman.tex ]; then exit 1; fi # don't clean the manual
  136.     -rm -f tangle.* weave.* common.* # remove links that may be obsolete
  137.     -rm -f *.unsorted *.list grammar.web outtoks.web scraps.web 
  138.     -rm -f cycle.test spider.slog
  139.     -rm -f *.c *.o *.tex *.toc *.dvi *.log *.makelog *~ *.wlog *.printlog
  140.  
  141.  
  142.  
  143. # booting the new distribution
  144. boot:
  145.     cd ../master; rm -f *.o; for i in $(COMMONC); do \
  146.         $(CC) $(CFLAGS) -c $$i; \
  147.         mv *.o $(OBDIR) ; \
  148.     done; cd ../c
  149.     $(CC) $(CFLAGS) -c $(TANGLESRC).c; \
  150.     $(CC) $(CFLAGS) -o $(DEST)/$(THETANGLE) $(COMMONOBJS) $(TANGLESRC).o
  151.  
  152.  
  153.